package com.btobtob.a.biz.user.protocol;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.61.0)",
    comments = "Source: Demo3.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class Demo3Grpc {

  private Demo3Grpc() {}

  public static final java.lang.String SERVICE_NAME = "Demo3";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.btobtob.a.biz.user.protocol.Demo3Request,
      com.btobtob.a.biz.user.protocol.Demo3Reply> getPost3Method;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "post3",
      requestType = com.btobtob.a.biz.user.protocol.Demo3Request.class,
      responseType = com.btobtob.a.biz.user.protocol.Demo3Reply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.btobtob.a.biz.user.protocol.Demo3Request,
      com.btobtob.a.biz.user.protocol.Demo3Reply> getPost3Method() {
    io.grpc.MethodDescriptor<com.btobtob.a.biz.user.protocol.Demo3Request, com.btobtob.a.biz.user.protocol.Demo3Reply> getPost3Method;
    if ((getPost3Method = Demo3Grpc.getPost3Method) == null) {
      synchronized (Demo3Grpc.class) {
        if ((getPost3Method = Demo3Grpc.getPost3Method) == null) {
          Demo3Grpc.getPost3Method = getPost3Method =
              io.grpc.MethodDescriptor.<com.btobtob.a.biz.user.protocol.Demo3Request, com.btobtob.a.biz.user.protocol.Demo3Reply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "post3"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.btobtob.a.biz.user.protocol.Demo3Request.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.btobtob.a.biz.user.protocol.Demo3Reply.getDefaultInstance()))
              .setSchemaDescriptor(new Demo3MethodDescriptorSupplier("post3"))
              .build();
        }
      }
    }
    return getPost3Method;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static Demo3Stub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<Demo3Stub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<Demo3Stub>() {
        @java.lang.Override
        public Demo3Stub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new Demo3Stub(channel, callOptions);
        }
      };
    return Demo3Stub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static Demo3BlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<Demo3BlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<Demo3BlockingStub>() {
        @java.lang.Override
        public Demo3BlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new Demo3BlockingStub(channel, callOptions);
        }
      };
    return Demo3BlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static Demo3FutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<Demo3FutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<Demo3FutureStub>() {
        @java.lang.Override
        public Demo3FutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new Demo3FutureStub(channel, callOptions);
        }
      };
    return Demo3FutureStub.newStub(factory, channel);
  }

  /**
   */
  public interface AsyncService {

    /**
     */
    default void post3(com.btobtob.a.biz.user.protocol.Demo3Request request,
        io.grpc.stub.StreamObserver<com.btobtob.a.biz.user.protocol.Demo3Reply> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPost3Method(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service Demo3.
   */
  public static abstract class Demo3ImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return Demo3Grpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service Demo3.
   */
  public static final class Demo3Stub
      extends io.grpc.stub.AbstractAsyncStub<Demo3Stub> {
    private Demo3Stub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected Demo3Stub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new Demo3Stub(channel, callOptions);
    }

    /**
     */
    public void post3(com.btobtob.a.biz.user.protocol.Demo3Request request,
        io.grpc.stub.StreamObserver<com.btobtob.a.biz.user.protocol.Demo3Reply> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getPost3Method(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service Demo3.
   */
  public static final class Demo3BlockingStub
      extends io.grpc.stub.AbstractBlockingStub<Demo3BlockingStub> {
    private Demo3BlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected Demo3BlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new Demo3BlockingStub(channel, callOptions);
    }

    /**
     */
    public com.btobtob.a.biz.user.protocol.Demo3Reply post3(com.btobtob.a.biz.user.protocol.Demo3Request request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getPost3Method(), getCallOptions(), request);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service Demo3.
   */
  public static final class Demo3FutureStub
      extends io.grpc.stub.AbstractFutureStub<Demo3FutureStub> {
    private Demo3FutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected Demo3FutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new Demo3FutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.btobtob.a.biz.user.protocol.Demo3Reply> post3(
        com.btobtob.a.biz.user.protocol.Demo3Request request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getPost3Method(), getCallOptions()), request);
    }
  }

  private static final int METHODID_POST3 = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_POST3:
          serviceImpl.post3((com.btobtob.a.biz.user.protocol.Demo3Request) request,
              (io.grpc.stub.StreamObserver<com.btobtob.a.biz.user.protocol.Demo3Reply>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getPost3Method(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.btobtob.a.biz.user.protocol.Demo3Request,
              com.btobtob.a.biz.user.protocol.Demo3Reply>(
                service, METHODID_POST3)))
        .build();
  }

  private static abstract class Demo3BaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    Demo3BaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.btobtob.a.biz.user.protocol.Demo3OuterClass.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("Demo3");
    }
  }

  private static final class Demo3FileDescriptorSupplier
      extends Demo3BaseDescriptorSupplier {
    Demo3FileDescriptorSupplier() {}
  }

  private static final class Demo3MethodDescriptorSupplier
      extends Demo3BaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    Demo3MethodDescriptorSupplier(java.lang.String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (Demo3Grpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new Demo3FileDescriptorSupplier())
              .addMethod(getPost3Method())
              .build();
        }
      }
    }
    return result;
  }
}
